package com.example.utils;

import cn.hutool.crypto.asymmetric.RSA;
import lombok.Data;

@Data
public class Result {

    private int code;

    private String data;

    private String sign;

    private RSA rsa;

    /****
     * error
     * @param error
     * @return
     */
    public static Result error(String error) {
        Result result = new Result();
        result.setCode(500);
        result.setData(error);
        return result;
    }

    /***
     * success
     * @param data
     * @param sign
     * @return
     */
    public static Result success(String data, String sign) {
        Result result = new Result();
        result.setCode(200);
        result.setData(data);
        result.setSign(sign);
        return result;
    }
}

